﻿@model IEnumerable<Player>

@{
    ViewBag.Title = "Spillere";
}

<div class="row">
    <div class="page-header">
        <h1><span class="glyphicon glyphicon-list"></span> @ViewBag.Title</h1>
    </div>
    <div class="col-md-12">
        
        <table class="table table-hover">
            <thead>
                <tr>
                    <th class="hidden-xs hidden-sm">
                        Initialer
                    </th>
                    <th>
                        Navn
                    </th>
                    <th class="hidden-xs hidden-sm">
                        Alder
                    </th>
                    <th>
                        Hcp
                    </th>
                    <th>
                        Dgu#
                    </th>
                    @if (User.Identity.IsAuthenticated)
                    {
                        <th>
                            Tlf.
                        </th>
                        <th>
                            Email
                        </th>
                    }
                    
                </tr>
            </thead>

            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <td class="hidden-xs hidden-sm">
                            @item.Initials
                        </td>
                        <td>
                            <span class="hidden-xs hidden-sm">
                                @Html.ActionLink(item.DisplayName, "Details", new { id = item.Id }, null)
                            </span>
                            <span class="hidden-md hidden-lg">
                                @Html.ActionLink(item.Initials, "Details", new { id = item.Id }, null)
                            </span>
                        </td>
                        <td class="hidden-xs hidden-sm">
                            @item.Age
                        </td>
                        <td>
                            @item.Hcp
                        </td>
                        <td>
                            @item.MemberNumber
                        </td>
                        @if (User.Identity.IsAuthenticated)
                        {
                            <td>
                                @item.MobilePhone
                            </td>
                            <td>
                                <span class="hidden-xs">
                                    <a href="mailto:@item.Email">@item.Email</a>
                                </span>
                                <span class="hidden-sm hidden-md hidden-lg">
                                    <a href="mailto:@item.Email">email</a>
                                </span>
                            </td>
                        }
        
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>